#pragma once
#ifndef __HWINCOMMANDLINE_H__
#define __HWINCOMMANDLINE_H__


#include "hwinstring.h"

namespace harlinn
{
    namespace windows
    {
        enum class CommandlineOptions
        {
            None = 0,
            FirstIsCommand = 1,
            ExpandWildCards = 2,
            ExpandEnvironmentVariables = 4,
            Default = FirstIsCommand | ExpandWildCards | ExpandEnvironmentVariables
        };
        DEFINE_ENUM_FLAG_OPERATORS(CommandlineOptions)

        class Commandline : std::vector<String>
        {
            
        private:
            String commandline;
            String command;
            CommandlineOptions options;
            void Parse();
            const wchar_t* ParseFirst(const wchar_t* start, const wchar_t* end);
            const wchar_t* ParseArgument(const wchar_t* start, const wchar_t* end);
            void Expand(const String& theArgument);
        public:
            typedef std::vector<String> Base;
            HWIN_EXPORT Commandline();
            HWIN_EXPORT Commandline(const String& theCommandline, CommandlineOptions theCommandlineOptions = CommandlineOptions::Default);
            HWIN_EXPORT Commandline(const wchar_t* theCommandline, CommandlineOptions theCommandlineOptions = CommandlineOptions::Default);
            HWIN_EXPORT Commandline(const wchar_t* theCommandline, size_t theCommandlineLength, CommandlineOptions theCommandlineOptions = CommandlineOptions::Default);
            
            




        };


    };
};


#endif //__HWINCOMMANDLINE_H__
